package movEat.Definitions;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;


public class MovieDB{

	private String imdbName = null;
	private double stars ;
	private Rating rating = null;
	private List<Genre> genres = null;
	private Boolean isDrink = null;
	private List<Integer> actor_nums = null;;
	private String country = null;
	private int year = -1;
	private int id;
	
	public MovieDB(String name, int stars, String country, int year,Rating rating, boolean isDrink) {
		imdbName=name;
		this.stars=stars;
		this.country=country;
		this.isDrink=isDrink;
		this.year=year;
		this.rating=rating;
	}
	
	public MovieDB(){
		
	}
	public String getImdbName() {
		return imdbName;
	}
	public void setImdbName(String imdbName) {
		this.imdbName = imdbName;
	}
	public double getStars() {
		return stars;
	}
	public void setStars(double stars) {
		this.stars = stars;
	}
	public Rating getRating() {
		return rating;
	}
	public void setRating(Rating rating) {
		this.rating = rating;
	}
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	public Boolean getIsDrink() {
		return isDrink;
	}
	public void setIsDrink(Boolean isDrink) {
		this.isDrink = isDrink;
	}
	public List<Genre> getGenres() {
		return genres;
	}
	public void setGenres(List<Genre> genres) {
		this.genres = genres;
	}
	public int getYear() {
		return year;
	}
	public void setYear(int year) {
		this.year = year;
	}
	public void setActor_nums(List<Integer> actor_nums) {
		this.actor_nums = actor_nums;
	}
	public List<Integer> getActor_nums() {
		return actor_nums;
	}
	
	public void addGenre(Genre genre){
		if (genres==null)
			genres=new ArrayList<Genre>();
		genres.add(genre);
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}


	public static Comparator<MovieDB> movieDBComparator = new Comparator<MovieDB>() {
		
		@Override
		public int compare(MovieDB arg0, MovieDB arg1) {
			return arg0.getImdbName().compareToIgnoreCase(arg1.getImdbName());
		}
	};  
}
